Skip to content

Track page activity; unify marquee/selection#447

Open
bobsingor wants to merge 6 commits intomainfrom
fix/page-elevation-on-menu
Open

Track page activity; unify marquee/selection#447
bobsingor wants to merge 6 commits intomainfrom
fix/page-elevation-on-menu

Conversation

@bobsingor
Copy link
Contributor

Introduce page-activity tracking and unify marquee + text selection behavior across plugins.

  • Interaction Manager: add page activity bookkeeping, emit onPageActivityChange, and expose claim/release/hasPageActivity on the capability and per-document scope.
  • Selection Plugin: expand enableForMode options to control selection vs marquee, propagate modeId in marquee/text handlers, avoid marquee during text selection, switch marquee registration to registerAlways, and publish marquee events that include modeId; added page-activity claims for selection menu placement.
  • Redaction Plugin: remove legacy marquee handler and RegisterMarqueeOnPage API; consume selection marquee events instead, forward marquee preview/end to create redactions (annotation or legacy), and expose onRedactionMarqueeChange.
  • Scroll Plugin: optionally depends on interaction-manager, listens for page-activity changes to mark/elevate pages in the scroller layout and applies z-index/elevated flag to page containers.
  • Handlers/types/components: update marquee/text handlers signatures to include modeId, remove marquee-redact.handler and its types, and update React/Svelte/Vue marquee and scroller components to use the new events/flags.

Introduce page-activity tracking and unify marquee + text selection behavior across plugins.

- Interaction Manager: add page activity bookkeeping, emit onPageActivityChange, and expose claim/release/hasPageActivity on the capability and per-document scope.
- Selection Plugin: expand enableForMode options to control selection vs marquee, propagate modeId in marquee/text handlers, avoid marquee during text selection, switch marquee registration to registerAlways, and publish marquee events that include modeId; added page-activity claims for selection menu placement.
- Redaction Plugin: remove legacy marquee handler and RegisterMarqueeOnPage API; consume selection marquee events instead, forward marquee preview/end to create redactions (annotation or legacy), and expose onRedactionMarqueeChange.
- Scroll Plugin: optionally depends on interaction-manager, listens for page-activity changes to mark/elevate pages in the scroller layout and applies z-index/elevated flag to page containers.
- Handlers/types/components: update marquee/text handlers signatures to include modeId, remove marquee-redact.handler and its types, and update React/Svelte/Vue marquee and scroller components to use the new events/flags.

Notes: This includes breaking API changes (interaction manager capability, selection handler signatures, and redaction marquee API) — callers should update to the new claim/release page activity methods and new marquee/selection signatures.
@vercel
Copy link

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
embed-pdf-snippet Ready Ready Preview, Comment Feb 6, 2026 9:43pm
embed-pdf-viewer-react-mui Ready Ready Preview, Comment Feb 6, 2026 9:43pm
embed-pdf-viewer-svelte-tailwind Ready Ready Preview, Comment Feb 6, 2026 9:43pm
embed-pdf-viewer-vue-vuetify Ready Ready Preview, Comment Feb 6, 2026 9:43pm
embed-pdf-website Ready Ready Preview, Comment Feb 6, 2026 9:43pm

Request Review

Combine text selection and marquee selection under a single enableForMode API and refactor SelectionLayer to orchestrate both. Add new EnableForModeOptions (enableSelection, showSelectionRects, enableMarquee, showMarqueeRects) and deprecate showRects, setMarqueeEnabled, and isMarqueeEnabled. Events now include modeId for selection and marquee lifecycles. SelectionLayer now composes a new TextSelection component alongside MarqueeSelection so consumers no longer need to render MarqueeSelection separately; a standalone TextSelection export was also added for advanced use. Expose textStyle and marqueeStyle props (background, borderColor, borderStyle) and introduce TextSelectionStyle/MarqueeSelectionStyle types; MarqueeSelection props updated to CSS-standard names (old stroke/fill deprecated). Update Svelte/Vue example usage to remove standalone MarqueeSelection. Also include autogenerated/formatting changes to pdfium vendor function typings.
Introduce an onEmptySpaceClick event to the selection system and wire it through handlers so clicks on page background (evt.target === evt.currentTarget) fire for all modes. Updates include:

- New EmptySpaceClickEvent and EmptySpaceClickScopeEvent types and added onEmptySpaceClick to SelectionScope and SelectionCapability.
- Text selection handler accepts an onEmptySpaceClick callback and detects empty-space pointer-downs.
- SelectionPlugin emits scoped and global empty-space click events and clears them on scope/destroy.
- RedactionPlugin subscribes to selection's onEmptySpaceClick to deselect pending redactions when the user clicks empty page space.
- Adds changesets for the selection and redaction plugins and a minor formatting tweak in annotation-plugin.

This restores background-click-to-deselect behavior that was lost during marquee unification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant